/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package nodeLevelMetaModel.impl;

import nodeLevelMetaModel.BaseStationRole;
import nodeLevelMetaModel.LeaderRole;
import nodeLevelMetaModel.NodeLevelMetaModelPackage;
import nodeLevelMetaModel.ReceivingTask;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Receiving Task</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link nodeLevelMetaModel.impl.ReceivingTaskImpl#getProtocol <em>Protocol</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.ReceivingTaskImpl#getReceiveDataType <em>Receive Data Type</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.ReceivingTaskImpl#getCompress <em>Compress</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.ReceivingTaskImpl#getEncryption <em>Encryption</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.ReceivingTaskImpl#getName12 <em>Name12</em>}</li>
 *   <li>{@link nodeLevelMetaModel.impl.ReceivingTaskImpl#getName13 <em>Name13</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ReceivingTaskImpl extends EObjectImpl implements ReceivingTask {
	/**
	 * The default value of the '{@link #getProtocol() <em>Protocol</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getProtocol()
	 * @generated
	 * @ordered
	 */
	protected static final String PROTOCOL_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getProtocol() <em>Protocol</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getProtocol()
	 * @generated
	 * @ordered
	 */
	protected String protocol = PROTOCOL_EDEFAULT;

	/**
	 * The default value of the '{@link #getReceiveDataType() <em>Receive Data Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReceiveDataType()
	 * @generated
	 * @ordered
	 */
	protected static final String RECEIVE_DATA_TYPE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getReceiveDataType() <em>Receive Data Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReceiveDataType()
	 * @generated
	 * @ordered
	 */
	protected String receiveDataType = RECEIVE_DATA_TYPE_EDEFAULT;

	/**
	 * The default value of the '{@link #getCompress() <em>Compress</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCompress()
	 * @generated
	 * @ordered
	 */
	protected static final String COMPRESS_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getCompress() <em>Compress</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCompress()
	 * @generated
	 * @ordered
	 */
	protected String compress = COMPRESS_EDEFAULT;

	/**
	 * The default value of the '{@link #getEncryption() <em>Encryption</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEncryption()
	 * @generated
	 * @ordered
	 */
	protected static final String ENCRYPTION_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getEncryption() <em>Encryption</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEncryption()
	 * @generated
	 * @ordered
	 */
	protected String encryption = ENCRYPTION_EDEFAULT;

	/**
	 * The cached value of the '{@link #getName12() <em>Name12</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName12()
	 * @generated
	 * @ordered
	 */
	protected LeaderRole name12;

	/**
	 * The cached value of the '{@link #getName13() <em>Name13</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName13()
	 * @generated
	 * @ordered
	 */
	protected BaseStationRole name13;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ReceivingTaskImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return NodeLevelMetaModelPackage.Literals.RECEIVING_TASK;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getProtocol() {
		return protocol;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setProtocol(String newProtocol) {
		String oldProtocol = protocol;
		protocol = newProtocol;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.RECEIVING_TASK__PROTOCOL, oldProtocol, protocol));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getReceiveDataType() {
		return receiveDataType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setReceiveDataType(String newReceiveDataType) {
		String oldReceiveDataType = receiveDataType;
		receiveDataType = newReceiveDataType;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.RECEIVING_TASK__RECEIVE_DATA_TYPE, oldReceiveDataType, receiveDataType));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getCompress() {
		return compress;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCompress(String newCompress) {
		String oldCompress = compress;
		compress = newCompress;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.RECEIVING_TASK__COMPRESS, oldCompress, compress));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getEncryption() {
		return encryption;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setEncryption(String newEncryption) {
		String oldEncryption = encryption;
		encryption = newEncryption;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.RECEIVING_TASK__ENCRYPTION, oldEncryption, encryption));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LeaderRole getName12() {
		if (name12 != null && name12.eIsProxy()) {
			InternalEObject oldName12 = (InternalEObject)name12;
			name12 = (LeaderRole)eResolveProxy(oldName12);
			if (name12 != oldName12) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, NodeLevelMetaModelPackage.RECEIVING_TASK__NAME12, oldName12, name12));
			}
		}
		return name12;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LeaderRole basicGetName12() {
		return name12;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName12(LeaderRole newName12) {
		LeaderRole oldName12 = name12;
		name12 = newName12;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.RECEIVING_TASK__NAME12, oldName12, name12));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BaseStationRole getName13() {
		if (name13 != null && name13.eIsProxy()) {
			InternalEObject oldName13 = (InternalEObject)name13;
			name13 = (BaseStationRole)eResolveProxy(oldName13);
			if (name13 != oldName13) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, NodeLevelMetaModelPackage.RECEIVING_TASK__NAME13, oldName13, name13));
			}
		}
		return name13;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BaseStationRole basicGetName13() {
		return name13;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName13(BaseStationRole newName13) {
		BaseStationRole oldName13 = name13;
		name13 = newName13;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, NodeLevelMetaModelPackage.RECEIVING_TASK__NAME13, oldName13, name13));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.RECEIVING_TASK__PROTOCOL:
				return getProtocol();
			case NodeLevelMetaModelPackage.RECEIVING_TASK__RECEIVE_DATA_TYPE:
				return getReceiveDataType();
			case NodeLevelMetaModelPackage.RECEIVING_TASK__COMPRESS:
				return getCompress();
			case NodeLevelMetaModelPackage.RECEIVING_TASK__ENCRYPTION:
				return getEncryption();
			case NodeLevelMetaModelPackage.RECEIVING_TASK__NAME12:
				if (resolve) return getName12();
				return basicGetName12();
			case NodeLevelMetaModelPackage.RECEIVING_TASK__NAME13:
				if (resolve) return getName13();
				return basicGetName13();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.RECEIVING_TASK__PROTOCOL:
				setProtocol((String)newValue);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__RECEIVE_DATA_TYPE:
				setReceiveDataType((String)newValue);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__COMPRESS:
				setCompress((String)newValue);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__ENCRYPTION:
				setEncryption((String)newValue);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__NAME12:
				setName12((LeaderRole)newValue);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__NAME13:
				setName13((BaseStationRole)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.RECEIVING_TASK__PROTOCOL:
				setProtocol(PROTOCOL_EDEFAULT);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__RECEIVE_DATA_TYPE:
				setReceiveDataType(RECEIVE_DATA_TYPE_EDEFAULT);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__COMPRESS:
				setCompress(COMPRESS_EDEFAULT);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__ENCRYPTION:
				setEncryption(ENCRYPTION_EDEFAULT);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__NAME12:
				setName12((LeaderRole)null);
				return;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__NAME13:
				setName13((BaseStationRole)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case NodeLevelMetaModelPackage.RECEIVING_TASK__PROTOCOL:
				return PROTOCOL_EDEFAULT == null ? protocol != null : !PROTOCOL_EDEFAULT.equals(protocol);
			case NodeLevelMetaModelPackage.RECEIVING_TASK__RECEIVE_DATA_TYPE:
				return RECEIVE_DATA_TYPE_EDEFAULT == null ? receiveDataType != null : !RECEIVE_DATA_TYPE_EDEFAULT.equals(receiveDataType);
			case NodeLevelMetaModelPackage.RECEIVING_TASK__COMPRESS:
				return COMPRESS_EDEFAULT == null ? compress != null : !COMPRESS_EDEFAULT.equals(compress);
			case NodeLevelMetaModelPackage.RECEIVING_TASK__ENCRYPTION:
				return ENCRYPTION_EDEFAULT == null ? encryption != null : !ENCRYPTION_EDEFAULT.equals(encryption);
			case NodeLevelMetaModelPackage.RECEIVING_TASK__NAME12:
				return name12 != null;
			case NodeLevelMetaModelPackage.RECEIVING_TASK__NAME13:
				return name13 != null;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (protocol: ");
		result.append(protocol);
		result.append(", receiveDataType: ");
		result.append(receiveDataType);
		result.append(", compress: ");
		result.append(compress);
		result.append(", encryption: ");
		result.append(encryption);
		result.append(')');
		return result.toString();
	}

} //ReceivingTaskImpl
